/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: NewDateDemo
 * Author:   666
 * Date:     2022/1/16 11:07
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.newdateapi;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.MonthDay;
import java.util.Objects;

/**
 * @Classname NewDateDemo
 * @Description TODO
 * @Date 2022/1/16 11:07
 * @Created by 666
 */
public class NewDateDemo {
    public static void main(String[] args) {
        //获取当前时间
        LocalDateTime localDateTime = LocalDateTime.now();
        LocalDate localDate = LocalDate.now();
        LocalTime localTime = LocalTime.now();
        System.out.println(localDateTime.getHour());
        System.out.println(localDate.getDayOfYear());
        System.out.println(localTime.getHour());

        System.out.println("-----------------");
        //1、判断是否您的生日
        LocalDate birDay = LocalDate.of(1987, 1, 16);
        LocalDate localDate1 = LocalDate.now();
        System.out.println(birDay.getDayOfMonth());
//        MonthDay myBir = MonthDay.of(birDay.getMonthValue(), birDay.getDayOfMonth());

        MonthDay myBir = MonthDay.from(birDay);

        MonthDay nowDay = MonthDay.from(localDate1);
        System.out.println(Objects.equals(myBir,nowDay));

    }
}
